package rpc.retry;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import rpc.client.RPCFuture;
import rpc.client.RpcClientHandler;
import rpc.protocol.RpcRequest;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.DelayQueue;

@Configuration
public class RetryPool {

    @Bean
    public DelayQueue<RetryTask> retryTaskDelayQueue(){
        return new DelayQueue<>();
    }

    @Bean
    public Map<String, RPCFuture> pendingRPC(){
        return new ConcurrentHashMap<>();
    }
}
